< previous page page_457 next page >

Page 457
LISTING 20.4. THE SEQUENCE OF INTERACTIONS BETWEEN THESE SUBSYSTEMS, FROM THE INITIALIZATION OF THE APPLICATION TO THE COMPLETED AUTHORIZATION AND AUTHENTICATION.

9f8044bafea36a1f728739c0bb58ef4c.gif
  1: 'In modMain
  2: Public Sub Main()
  3:     Dim bState As Byte
  4:     bState = theApplication.initializeSystem
  5: End Sub
  6: 'In CApplication
  7: Public Function initializeSystem() As Byte
  8:     Dim returns
  9:     Set theAppTransactions = New AppTransactions
 10:
 11:     m_returns =  theAppTransactions.setRichTextBox(frmLog!rtbDBLog,
                       frmLog!rtbMemoryLog)
 12:     Set theSession = New CSession
 13:     theAppTransactions.activateLogging
 14:     theMDIController.showForm
 15:     theSession.showForm
 16:     'theAppTransactions.deactivateLogging
 17:     theAppTransactions.addTrans2MemLog _
 18:         Allocated memory for theAppTransactions in
               CApplication.initializeSystem
 19:     theAppTransactions.addTrans2MemLog _
 20:         Allocated memory for theSession in
                CApplication.initializeSystem
 21:     theAppTransactions.addTrans2MemLog _
 22:         Allocated memory for ifcDBConnection in  & TypeName(Me) &
               .initializeSystem
 23:     m_returns = theAppTransactions.addTrans2Text(Starting up the  &
                      App.EXEName &  system)
 24:
 25:     'Connect to the database
 26:     'returns = ifcDBConnection.OpenConnection(, App.Path &
                    \bank.mdb, False)
 27: End Function
 28:
 29: 'In CSession
 30: 'Show the login form
 31: Public Sub showForm()
 32:     theForm.Show
 33: End Sub
 34: 'When the user fills in the UserID and Password, and then
 35: 'clicks 'Login', the following method is invoked
 36: Public Sub clickedLogin()
 37:     Dim returns
 38:     Set theEncryptor = New SHA1Encryption
 39:     theApplication.theUser.UserID = theForm.txtUserID
 40:     theApplication.theUser.UserPassword =  theEncryptor.encrypt
                                                  (theForm.txtPassword)
continues

 
< previous page page_457 next page >

If you like this book, buy it!